package com.jing.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.jing.mall.common.valid.AddValid;
import com.jing.mall.common.valid.ListValue;
import com.jing.mall.common.valid.UpdValid;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 *
 * @author jingyang
 * @email 1532800767@qq.com
 * @date 2022-05-30 01:19:04
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */

	@TableId()
	@Null(message = "新增时品牌id必须为空",groups = {AddValid.class})
	@NotNull(message = "品牌id不能为空",groups = {UpdValid.class})
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空",groups = {AddValid.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotEmpty(groups = {AddValid.class})
	@URL(message = "必须是一个合法的url地址",groups = {AddValid.class,UpdValid.class})
	private String logo;
	/**
	 * 介绍
	 */
	@NotEmpty(groups = {AddValid.class})
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(groups = {AddValid.class})
	@ListValue(vals = {0,1},groups = {AddValid.class,UpdValid.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty(groups = {AddValid.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "必须是a-z或A-Z的字母",groups = {AddValid.class,UpdValid.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(groups = {AddValid.class})
	@Min(value = 0,message = "排序必须大于等于0",groups = {AddValid.class,UpdValid.class})
	private Integer sort;

}
